package northwind.model;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "Products")
public class Product extends BaseEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ProductID")
	private int productID;

	@ManyToOne
	@JoinColumn(name = "CategoryID")
	private Category category;

	@Column(name = "Discontinued")
	private boolean discontinued;

	@Column(name = "ProductName")
	private Object productName;

	@Column(name = "QuantityPerUnit")
	private Object quantityPerUnit;

	@Column(name = "ReorderLevel")
	private short reorderLevel;

	@Column(name = "SupplierID")
	private int supplierID;

	@Column(name = "UnitPrice")
	private BigDecimal unitPrice;

	@Column(name = "UnitsInStock")
	private short unitsInStock;

	@Column(name = "UnitsOnOrder")
	private short unitsOnOrder;

	public Product() {
	}

	public int getProductID() {
		return this.productID;
	}

	public void setProductID(int productID) {
		this.productID = productID;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public boolean getDiscontinued() {
		return this.discontinued;
	}

	public void setDiscontinued(boolean discontinued) {
		this.discontinued = discontinued;
	}

	public Object getProductName() {
		return this.productName;
	}

	public void setProductName(Object productName) {
		this.productName = productName;
	}

	public Object getQuantityPerUnit() {
		return this.quantityPerUnit;
	}

	public void setQuantityPerUnit(Object quantityPerUnit) {
		this.quantityPerUnit = quantityPerUnit;
	}

	public short getReorderLevel() {
		return this.reorderLevel;
	}

	public void setReorderLevel(short reorderLevel) {
		this.reorderLevel = reorderLevel;
	}

	public int getSupplierID() {
		return this.supplierID;
	}

	public void setSupplierID(int supplierID) {
		this.supplierID = supplierID;
	}

	public BigDecimal getUnitPrice() {
		return this.unitPrice;
	}

	public void setUnitPrice(BigDecimal unitPrice) {
		this.unitPrice = unitPrice;
	}

	public short getUnitsInStock() {
		return this.unitsInStock;
	}

	public void setUnitsInStock(short unitsInStock) {
		this.unitsInStock = unitsInStock;
	}

	public short getUnitsOnOrder() {
		return this.unitsOnOrder;
	}

	public void setUnitsOnOrder(short unitsOnOrder) {
		this.unitsOnOrder = unitsOnOrder;
	}

	@Override
	public String toString() {
		return "Product [productID=" + productID + ", category=" + category
				+ ", discontinued=" + discontinued + ", productName="
				+ productName + ", quantityPerUnit=" + quantityPerUnit
				+ ", reorderLevel=" + reorderLevel + ", supplierID="
				+ supplierID + ", unitPrice=" + unitPrice + ", unitsInStock="
				+ unitsInStock + ", unitsOnOrder=" + unitsOnOrder + "]";
	}

	@Override
	public Integer getId() {
		return this.productID;
	}

}
